package com.mlyol.singleton;

public class Demo2 {

    public static void main(String[] args) {
        Demo2 instance1 = Demo2.getInstance();
        Demo2 instance2 = Demo2.getInstance();
        System.out.println(instance1==instance2);
    }

    private Demo2() {

    }

    private static Demo2 instance;

    static {
        instance = new Demo2();
    }

    public static Demo2 getInstance() {
        return instance;
    }


}
